<template>
	<view class="webView-page">
		<web-view id="webView" :src="url" @message="webViewMsg"></web-view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: '',
				params: {}
			}
		},
		onLoad(params) {
			console.log(params);
			this.url = `/hybrid/html/map/index.html?location=${params.locations}`
			this.params = params
		},
		methods: {
			webViewMsg(e) {
				console.log(e);
				let data = e.detail.data[0].action
				uni.$emit('selectMap',data)
				uni.navigateBack();
				// console.log(this.params.noticeId);
				// this.$u.api.record.info(4, this.params.noticeId).then(res => {
				// 	let urlArr = res.data.url && res.data.url != '' ? res.data.url.split(',') : []
				// 	urlArr.push(data.url)
				// 	return this.$u.api.record.edit(4, {
				// 		noticeId: this.params.noticeId,
				// 		archivesId: this.vuex_archives.archivesId,
				// 		jsonStr: [{}]
				// 	})
				// }).then(res => {
				// 	console.log(res);
				// 	if (res.code == 200) {
				// 		this.$refs.uToast.show({
				// 			isTab: true,
				// 			title: '上传成功',
				// 			type: 'success',
				// 			url: '/pages/sys/detail/index',
				// 			duration: 1000
				// 		})
				// 	}
				// })
			}
		}
	}
</script>

<style lang="scss" scoped>
	.webView-page {
		// background-color: #f3f4f6;
		height: 100vh;
	}
</style>
